package com.fowo.api.controller.shipment.wfs;

import com.fowo.api.model.platformshipping.PlatformshippingBatchcompletionpickingAction;
import com.fowo.api.model.platformshipping.PlatformshippingVo;
import com.fowo.api.service.impl.PlatformshippingServiceImpl;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Component
public class platformshippingBatchcompletionpickingAction implements PlatformshippingBatchcompletionpickingAction {
    @Resource
    private PlatformshippingServiceImpl platformshippingService;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void run(List<Long> idList) throws Exception {
        for(int i=0;i<idList.size();i++){
            handle(idList.get(i));
        }
    }
//完成拣货
    private void handle(Long aLong) throws Exception {
        PlatformshippingVo voById = platformshippingService.getVoById(aLong);
        voById.setPickingnot("0");
//        voById.setpickingnot
        platformshippingService.update(voById);
    }
}
